<%-- 
    Document   : form_add_emp
    Created on : Nov 24, 2013, 3:20:13 PM
    Author     : zraj
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<link rel="stylesheet" href="css/tabcss.css" />
<link rel="stylesheet" href="css/maincss.css" />
<style type="text/css">
    .required{
        background-color: #D3D3D3;
    }
    .input-required {
        background-color: #FFAA00;
    }
    
</style>
<script type="text/javascript">
    function addEmp()
    {
        var ready = 0;
        var msg = "";

        $('.required').each(function() {
            $(this).removeClass("input-required");
            if ($(this).val().length <= 0 || $(this).val() == -1 )
            {
                $(this).addClass("input-required");
                ready = 1;  
                alert("กรุณากรอกข้อมูลให้ครบถ้วน");
                $(this).focus();
                return false;
            }
          

        });
        
        if(ready == 0){
            $('#form-add-emp').attr("action","addEmpAndAddress");
            $('#form-add-emp').submit();
        }

    }

</script>

<s:form id="form-add-emp" action="" method="post" theme="simple">
    <table width="756" height="0" border="0" cellSpacing="0" cellPadding="0">
        <tbody><tr> 
                <td height="490" vAlign="top" background="images/left_menu_bg.jpg" width="169"><table border="0" cellSpacing="0" cellPadding="0" width="169">
                        <tbody><tr> 
                                <td><img src="images/tran.gif" width="10" height="8"></td>
                                <td>&nbsp;</td>
                                <td><img src="images/tran.gif" width="10" height="8"></td>
                            </tr>
                            <tr> 
                                <td width="10">&nbsp;</td>
                                <td width="149"><div align="center"><img src="#" width="126" height="169"> 
                                    </div></td>
                                <td width="10">&nbsp;</td>
                            </tr>
                            <tr> 
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr> 
                                <td background="images/left_menu_head_bg.jpg" colSpan="3"><div align="center"><span class="style2">รหัสพนักงาน</span> 
                                        <span class="style1">
                                            <s:textfield id="empID" cssClass="required"   name="emp.empId" size="7"></s:textfield>
                                            </span></div></td>
                                </tr>
                                <tr> 
                                    <td colSpan="3"><img src="images/left_menu_showdow_bg.jpg" width="168" height="13"></td>
                                </tr>
                            </tbody></table></td>
                    <td bgColor="#f8f8f8" vAlign="top" width="587"><table border="0" cellSpacing="2" cellPadding="0" width="589">
                            <tbody><tr> 
                                    <td height="0" width="12">&nbsp;</td>
                                    <td vAlign="top" width="559"> <table border="0" cellSpacing="0" cellPadding="0" width="557">
                                            <tbody><tr> 
                                                    <td height="19">&nbsp;</td>
                                                    <td colSpan="6"><table border="0" cellSpacing="0" cellPadding="0" width="100">
                                                            <tbody><tr> 
                                                                    <td bgColor="#e4e4e4" height="20" width="200"> 
                                                                        <span class="style9">ข้อมูลพนักงาน</span> 
                                                                    </td>
                                                                </tr>
                                                                <tr> 
                                                                    <td><img src="images/border_footer_menu.jpg" width="100" height="5"></td>
                                                                </tr>
                                                            </tbody></table></td>
                                                </tr>
                                                <tr> 
                                                    <td height="17">&nbsp;</td>
                                                    <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                            <tbody><tr> 
                                                                    <td height="15" width="97">ชื่อ-สกุล</td>
                                                                    <td bgColor="#ffffcc" width="286"><span class="style7">
                                                                            <label>คำนำหน้า</label>
                                                                        <s:select 
                                                                            cssClass="required"
                                                                            list="listTitle" 
                                                                            name="emp.titleNameID" 
                                                                            listKey="titleID"
                                                                            listValue="titleTH"
                                                                            headerKey="-1"
                                                                            headerValue="--เลือก--">

                                                                        </s:select></span><span class="style7">
                                                                            <br/>  <label>ชื่อ</label><s:textfield cssClass="required" id="nameTH" name="emp.nameTH" ></s:textfield></span><span class="style7">
                                                                        <br/>     <label>นามสกุล</label><s:textfield cssClass="required" id="surnameTH" name="emp.surnameTH"></s:textfield></span><span class="style8"><a href="PartB1NameSurname"> </a></span></td>
                                                                    <td width="72">ชื่อเล่น</td>
                                                                    <td bgColor="#ffffcc" width="89"><span class="style7"><s:textfield id="nickName" size="7" name="emp.nickname"></s:textfield></span></td>
                                                                </tr>
                                                            </tbody></table></td>
                                                </tr>
                                                <tr> 
                                                    <td height="18">&nbsp;</td>
                                                    <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                            <tbody><tr> 
                                                                    <td height="15" width="97">first-last</td>
                                                                    <td bgColor="#ffffcc" width="286"><span class="style7">
                                                                         </span><span class="style7"><br/>  <label>firstname</label><s:textfield id="nameEN" name="emp.nameEN" ></s:textfield>
                                                                    </span><span class="style7"><br/>  <label>lastname</label><s:textfield id="surnameEN" name="emp.surnameEN" ></s:textfield></span><span class="style8"><a href="PartB1NameSurname"> </a></span></td>
                                                                    <td width="72">เพศ</td>
                                                                    <td class="style7" bgColor="#ffffcc" width="89">
                                                                    <s:select 
                                                                        cssClass="required"
                                                                        list="listSexType" 
                                                                        name="emp.sexID" 
                                                                        listKey="sexID"
                                                                        listValue="sexName"
                                                                        headerKey="-1"
                                                                        headerValue="--เลือก--">

                                                                    </s:select></td>
                                                            </tr>
                                                        </tbody></table></td>
                                            </tr>
                                            <tr> 
                                                <td>&nbsp;</td>
                                                <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                        <tbody><tr> 
                                                                <td height="15" width="97">เชื้อชาติ</td>
                                                                <td bgColor="#ffffcc" width="112"><span class="style7"><s:textfield name="emp.birthPlace" size="13"></s:textfield></span></td>
                                                                    <td width="73">สัญชาติ</td>
                                                                    <td bgColor="#ffffcc" width="100"><span class="style7"><s:textfield name="emp.nationallity" size="7" ></s:textfield></span></td>
                                                                    <td width="70">ศาสนา</td>
                                                                    <td bgColor="#ffffcc" width="90"><span class="style7">
                                                                        <s:select 
                                                                            cssClass="required"
                                                                            list="listReligion" 
                                                                            name="emp.religionID" 
                                                                            listKey="religionID"
                                                                            listValue="religionName"
                                                                            headerKey="-1"
                                                                            headerValue="--เลือก--">
                                                                        </s:select></span></td>
                                                            </tr>
                                                        </tbody></table></td>
                                            </tr>
                                            <tr> 
                                                <td>&nbsp;</td>
                                                <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                        <tbody><tr> 
                                                                <td height="15" width="97">จังหวัดที่เกิด</td>
                                                                <td bgColor="#ffffcc" width="112"><span class="style7">
                                                                        <s:select 
                                                                            cssClass="required"
                                                                            list="listProvince" 
                                                                            name="emp.birthProvince" 
                                                                            listKey="provinceID"
                                                                            listValue="provinceName"
                                                                            headerKey="-1"
                                                                            headerValue="--เลือก--">
                                                                        </s:select>
                                                                    </span></td>
                                                                <td width="73">กรุ๊ปเลือด</td>
                                                                <td bgColor="#ffffcc" width="100"><span class="style7"><s:select 
                                                                    cssClass="required"       
                                                                    list="listBloodType" 
                                                                            name="emp.bloodTypeID" 
                                                                            listKey="bloodType"
                                                                            listValue="bloodTypeName"
                                                                            headerKey="-1"
                                                                            headerValue="--เลือก--">
                                                                        </s:select></span> </td>
                                                                <td width="70"></td>
                                                                <td bgColor="#ffffcc" width="90"><span class="style7"></span></td>
                                                            </tr>
                                                        </tbody></table></td>
                                            </tr>
                                            <tr> 
                                                <td>&nbsp;</td>
                                                <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                        <tbody><tr> 
                                                                <td height="16" width="97">เลขที่บัตรประชาชน</td>
                                                                <td bgColor="#ffffcc" width="112"><span class="style7"><s:textfield cssClass="required" id="idcardNumber" size="13" name="emp.idcardNumber"></s:textfield></span></td>
                                                                    <td width="73">วันออกบัตร</td>
                                                                    <td bgColor="#ffffcc" width="100"><span class="style7"><sj:datepicker  showOn="focus" name="emp.idcardStartDate" size="7" displayFormat="dd/mm/yy" changeMonth="true" changeYear="true" yearRange="2000:2025" ></sj:datepicker></span></td>
                                                                    <td width="70">บัตรหมดอายุ</td>
                                                                    <td bgColor="#ffffcc" width="90"><span class="style7"><sj:datepicker showOn="focus" name="emp.idcardEndDate" size="7" displayFormat="dd/mm/yy" changeMonth="true" changeYear="true" yearRange="2000:2025" ></sj:datepicker></span></td>
                                                                </tr>
                                                            </tbody></table></td>
                                                </tr>
                                                <tr> 
                                                    <td width="11">&nbsp;</td>
                                                    <td width="1793" colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                            <tbody><tr> 
                                                                    <td height="16" width="97">วัน/เดือน/ปี เกิด</td>
                                                                    <td bgColor="#ffffcc" width="112"><span class="style7"><sj:datepicker  showOn="focus" name="emp.birthDate" size="13" displayFormat="dd/mm/yy" changeMonth="true" changeYear="true" yearRange="1910:1998" ></sj:datepicker></span></td>
                                                                    <td width="73"></td>
                                                                    <td bgColor="#ffffcc" width="100"><span class="style7"></span> 
                                                                    </td>
                                                                    <td width="70">สถานภาพ</td>
                                                                    <td bgColor="#ffffcc" width="90"><span class="style7">
                                                                        <s:select 
                                                                            cssClass="required"
                                                                            list="listMarital" 
                                                                            name="emp.maritalStatusID" 
                                                                            listKey="statusId"
                                                                            listValue="statusName"
                                                                            headerKey="-1"
                                                                            headerValue="--เลือก--">
                                                                        </s:select>
                                                                    </span></td>
                                                            </tr>
                                                        </tbody></table></td>
                                            </tr>
                                            <tr> 
                                                <td height="17">&nbsp;</td>
                                                <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                        <tbody><tr> 
                                                                <td height="15" width="97">วันเข้างาน</td>
                                                                <td bgColor="#ffffcc" width="112"><span class="style7"><sj:datepicker showOn="focus" name="emp.workStartDate" size="13" displayFormat="dd/mm/yy" changeMonth="true" changeYear="true" yearRange="1910:2025" ></sj:datepicker></span></td>
                                                                    <td width="73">วันบรรจุ</td>
                                                                    <td bgColor="#ffffcc" width="100"><span class="style7"><sj:datepicker showOn="focus" name="emp.workRegisDate" size="7" displayFormat="dd/mm/yy" changeMonth="true" changeYear="true" yearRange="1910:2025" ></sj:datepicker></span></td>
                                                                    <td width="63">วันพ้นสภาพ</td>
                                                                    <td bgColor="#ffffcc" width="97"> <span class="style7"><sj:datepicker showOn="focus" name="emp.workEndDate" size="7" displayFormat="dd/mm/yy" changeMonth="true" changeYear="true" yearRange="1910:2025" ></sj:datepicker></span>                                  </td>
                                                                </tr>
                                                            </tbody></table></td>
                                                </tr>                          
                                                <tr> 
                                                    <td height="17">&nbsp;</td>
                                                    <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                            <tbody><tr> 
                                                                    <td height="15" width="97">บุคคลติดต่อฉุกเฉิน</td>
                                                                    <td bgColor="#ffffcc" width="286"><span class="style7"><s:textfield cssClass="required" size="28" name="emp.contactPerson"></s:textfield></span></td>
                                                                    <td width="63">โทรศัพท์</td>
                                                                    <td bgColor="#ffffcc" width="97"><span class="style7"><s:textfield size="7" name="emp.contactTel"></s:textfield></span></td>
                                                                </tr>
                                                            </tbody></table>
                                                    </td>
                                                </tr>
                                                 <tr> 
                                                    <td height="17">&nbsp;</td>
                                                    <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                            <tbody><tr> 
                                                                    <td height="16" width="96">จำนวนบุตร</td>
                                                                    <td bgColor="#ffffcc" width="113"><span class="style7">
                                                                        <s:textfield name="emp.children" size="13"></s:textfield></span></td>
                                                                    <td width="98"> เลขที่ประกันสังคม</td>
                                                                    <td bgColor="#ffffcc" width="230"> <span class="style7">
                                                                        <s:textfield name="emp.insureId" size="13"></s:textfield> 
                                                                    </span></td>
                                                            </tr>
                                                        </tbody></table>
                                                 </td>
                                                </tr>
                                                 <tr> 
                                                    <td height="17">&nbsp;</td>
                                                    <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                            <tbody><tr> 
                                                                    <td height="16" width="96">เลขที่บัญชีธนาคาร</td>
                                                                    <td bgColor="#ffffcc" width="113"><span class="style7">
                                                                        <s:textfield name="emp.bankId" size="13"></s:textfield></span></td>
                                                                    <td width="98" > เลขที่ทะเบียนสมรส</td>
                                                                    <td bgColor="#ffffcc" width="230"> <span class="style7">
                                                                        <s:textfield name="emp.marriedId" size="13"></s:textfield> 
                                                                    </span></td>
                                                            </tr>
                                                        </tbody></table>
                                                 </td>
                                                </tr>
                                                <tr> 
                                                    <td>&nbsp;</td>
                                                    <td colSpan="6"><table border="0" cellSpacing="0" cellPadding="0" width="100">
                                                            <tbody><tr> 
                                                                    <td bgColor="#e4e4e4" height="20" width="200"> 
                                                                        <span class="style9">การศึกษา </span></td>
                                                                </tr>
                                                                <tr> 
                                                                    <td><img src="images/border_footer_menu.jpg" width="100" height="5"></td>
                                                                </tr>
                                                            </tbody></table></td>
                                                </tr>
                                                <tr> 
                                                    <td>&nbsp;</td>
                                                    <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                            <tbody><tr> 
                                                                    <td height="15" width="97">วุฒิการศึกษา</td>
                                                                    <td bgColor="#ffffcc" width="112"> <span class="style7">
                                                                        <s:select 
                                                                            cssClass="required"
                                                                            list="listGraduation" 
                                                                            name="emp.graduateLevelID" 
                                                                            listKey="graduateLevelID"
                                                                            listValue="levelName"
                                                                            headerKey="-1"
                                                                            headerValue="--เลือก--">
                                                                        </s:select>
                                                                    </span>
                                                                    <span class="style8"></span></td>
                                                                <td width="73">สาขาวิชา</td>
                                                                <td bgColor="#ffffcc" width="131"><span class="style7">
                                                                        <s:textfield name="emp.graduateMajor" size="13"></s:textfield>
                                                                        </span></td>
                                                                    <td width="39"><div align="left">GPA.</div></td>
                                                                    <td bgColor="#ffffcc" width="90"><span class="style7">
                                                                        <s:textfield name="emp.gpa" size="7" ></s:textfield>
                                                                        </span></td>
                                                                </tr>
                                                            </tbody></table></td>
                                                </tr>
                                                <tr> 
                                                    <td height="17">&nbsp;</td>
                                                    <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                            <tbody><tr> 
                                                                    <td height="15" width="97">สถานศึกษา</td>
                                                                    <td bgColor="#ffffcc" width="286"><span class="style7"><s:textfield size="30" name="emp.graduateFrom"></s:textfield></span></td>
                                                                    <td width="63" bgColor="#ffffcc"></td>
                                                                    <td bgColor="#ffffcc" width="97"><span class="style7"></span></td>
                                                                </tr>
                                                            </tbody></table>
                                                    </td>
                                                </tr>

                                                <tr> 
                                                    <td>&nbsp;</td>
                                                    <td colSpan="6"><table border="0" cellSpacing="0" cellPadding="0" width="100">
                                                            <tbody><tr> 
                                                                    <td bgColor="#e4e4e4" height="20" width="200"> 
                                                                        <span class="style9">ตำแหน่ง </span></td>
                                                                </tr>
                                                                <tr> 
                                                                    <td><img src="images/border_footer_menu.jpg" width="100" height="5"></td>
                                                                </tr>
                                                            </tbody></table></td>
                                                </tr>
                                                <tr> 
                                                    <td>&nbsp;</td>
                                                    <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                            <tbody><tr> 
                                                                    <td height="16" width="96">ตำแหน่งงาน</td>
                                                                    <td bgColor="#ffffcc" width="113"><span class="style7">
                                                                        <s:textfield name="emp.positionName" size="13"></s:textfield></span></td>
                                                                    <td width="70"> หน่วยงาน</td>
                                                                    <td bgColor="#ffffcc" width="265"> <span class="style7">
                                                                        <s:select 
                                                                            cssClass="required"
                                                                            list="listDepartment" 
                                                                            name="emp.departmentID" 
                                                                            listKey="departmentID"
                                                                            listValue="departmentName"
                                                                            headerKey="-1"
                                                                            headerValue="--เลือก--">
                                                                        </s:select>
                                                                    </span></td>
                                                            </tr>
                                                        </tbody></table></td>
                                            </tr>
                                            <tr> 
                                                <td>&nbsp;</td>
                                                <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                        <tbody><tr> 
                                                                <td height="16" width="96">โทรศัพท์ภายใน</td>
                                                                <td bgColor="#ffffcc" width="113"><span class="style7">
                                                                        <s:textfield name="emp.companyTel" size="13"></s:textfield></span></td>
                                                                    <td width="70"> E-mail</td>
                                                                    <td bgColor="#ffffcc" width="265"> <span class="style7">
                                                                        <s:textfield name="emp.email"></s:textfield></span></td>
                                                                </tr>
                                                            </tbody></table></td>
                                                </tr>
                                                <tr> 
                                                    <td>&nbsp;</td>
                                                    <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                            <tbody><tr> 
                                                                    <td height="16" width="96">ประเภทพนักงาน</td>
                                                                    <td bgColor="#ffffcc" width="113"><span class="style7">
                                                                        <s:select 
                                                                            cssClass="required"
                                                                            list="listEmpType" 
                                                                            name="emp.empTypeID" 
                                                                            listKey="empTypeID"
                                                                            listValue="empTypeName"
                                                                            headerKey="-1"
                                                                            headerValue="--เลือก--">
                                                                        </s:select>
                                                                    </span></td>
                                                                <td width="70" bgColor="#ffffcc"></td>
                                                                <td bgColor="#ffffcc" width="265"> <span class="style7">
                                                                    </span></td>
                                                            </tr>
                                                        </tbody></table></td>
                                            </tr>
                                            <tr> 
                                                <td>&nbsp;</td>
                                                <td colSpan="6"><table border="0" cellSpacing="0" cellPadding="0" width="100">
                                                        <tbody><tr> 
                                                                <td bgColor="#e4e4e4" height="20" width="200"> 
                                                                    <span class="style9">ที่อยู่ปัจจุบัน </span></td>
                                                            </tr>
                                                            <tr> 
                                                                <td><img src="images/border_footer_menu.jpg" width="100" height="5"></td>
                                                            </tr>
                                                        </tbody></table></td>
                                            </tr>
                                            <tr> 
                                                <td>&nbsp;</td>
                                                <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                        <tbody><tr> 
                                                                <td height="15" width="97">เลขที่</td>
                                                                <td bgColor="#ffffcc" width="112"> <span class="style7">
                                                                        <s:textfield name="add.addressNo" size="13"></s:textfield>
                                                                        </span></td>
                                                                    <td width="73">ตรอก/ซอย</td>
                                                                    <td bgColor="#ffffcc" width="100"><span class="style7">
                                                                        <s:textfield name="add.soi" size="7"></s:textfield>
                                                                        </span></td>
                                                                    <td width="70">ถนน</td>
                                                                    <td bgColor="#ffffcc" width="90"><span class="style7">
                                                                        <s:textfield size="7" name="add.road"></s:textfield>
                                                                        </span></td>
                                                                </tr>
                                                            </tbody></table></td>
                                                </tr>
                                                <tr> 
                                                    <td height="16">&nbsp;</td>
                                                    <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                            <tbody><tr> 
                                                                    <td height="15" width="97">ตำบล/แขวง</td>
                                                                    <td bgColor="#ffffcc" width="112"><span class="style7">
                                                                        <s:textfield name="add.tambon" size="13"></s:textfield>
                                                                        </span></td>
                                                                    <td width="73">อำเภอ/เขต</td>
                                                                    <td bgColor="#ffffcc" width="100"><span class="style7">
                                                                        <s:textfield name="add.ampher" size="7" ></s:textfield>
                                                                        </span></td>
                                                                    <td width="70">จังหวัด</td>
                                                                    <td bgColor="#ffffcc" width="90"><span class="style7">
                                                                        <s:select 
                                                                            cssClass="required"
                                                                            list="listProvince" 
                                                                            name="add.provinceID" 
                                                                            listKey="provinceID"
                                                                            listValue="provinceName"
                                                                            headerKey="-1"
                                                                            headerValue="--เลือก--">
                                                                        </s:select>
                                                                    </span></td>
                                                            </tr>
                                                        </tbody></table></td>
                                            </tr>
                                            <tr> 
                                                <td height="17">&nbsp;</td>
                                                <td colSpan="6"><table border="0" cellSpacing="1" cellPadding="0" width="549">
                                                        <tbody><tr> 
                                                                <td width="97"> รหัสไปรษณีย์</td>
                                                                <td bgColor="#ffffcc" width="112"><span class="style7">
                                                                        <s:textfield name="add.shipcode" size="13"></s:textfield>
                                                                        </span></td>
                                                                    <td width="73">โทรศัพท์บ้าน</td>
                                                                    <td bgColor="#ffffcc" width="100"><span class="style7">
                                                                        <s:textfield name="add.homeTel" size="7"></s:textfield>
                                                                        </span></td>
                                                                    <td width="70">มือถือ</td>
                                                                    <td bgColor="#ffffcc" width="90"><span class="style7">
                                                                        <s:textfield name="add.mobile" size="7"></s:textfield>
                                                                        </span></td>
                                                                </tr>
                                                            </tbody></table></td>
                                                </tr>
                                                <tr>
                                                    <td colspan="7" style="text-align: center;">
                                                        -------------------------------------------------
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="7" style="text-align: center;">
                                                    <sj:a href="#" button="true" onclick="addEmp()" cssStyle="color:white;" >เพิ่มข้อมูล</sj:a>
                                                    </td>
                                                </tr>
                                            </tbody></table>
                                        <br> </td>
                                    <td width="12"><img src="images/tran.gif" width="10" height="8"></td>
                                </tr>

                            </tbody></table></td>
                </tr>
            </tbody>
        </table>

</s:form>

